package com.ztjy.sys.controller;

import com.github.pagehelper.PageInfo;
import com.ztjy.bean.Area;
import com.ztjy.sys.biz.AreaBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/sys/area")
public class AreaController {
    @Autowired
    private AreaBiz areaBiz;

    @RequestMapping("/areaList")
    public String AreaList(String pname, String cname, @RequestParam(value = "pageno", defaultValue = "1") Integer pageNo, Model model){
        Integer pageSize=6;
        PageInfo<Area> provinceAndCity = areaBiz.findProvinceAndCity(pname, cname, pageNo, pageSize);
        model.addAttribute("proCity",provinceAndCity);
        model.addAttribute("pname",pname);
        model.addAttribute("cname",cname);
        return "/sys/area/areaList.html";
    }

}
